<template>
   <van-nav-bar title="购物车" />
    <van-card
        num="1"
        price="2.00"
        desc="描述信息"
        title="商品标题"
        thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
        >
        <template #tags>
            <van-tag plain type="primary">标签</van-tag>
            <van-tag plain type="primary">标签</van-tag>
        </template>
        <template #footer>
            <van-button size="mini">按钮</van-button>
            <van-button size="mini">按钮</van-button>
        </template>
    </van-card>
 <van-submit-bar :price="3050" button-text="提交订单" @submit="onSubmit">
  <van-checkbox v-model="checked">全选</van-checkbox>
 
</van-submit-bar>
      


</template>

<script setup>
import { ref } from 'vue';
import { showToast } from 'vant';
import{createApi} from "@/api/api"
import { useRoute, useRouter } from 'vue-router'
const router = useRouter()
const route = useRoute()
const onSubmit = () => 
{
     let obj={
        username:localStorage.getItem('username'),
        goodsIds:'5799,5799',
        product_code:'非常好',
        totalPrice:"899",
        nums:"6,5"
     }
     createApi(obj).then(res=>{
        router.push({path:'order',query:{orderId:res.data.data.orderId}})
     })
}




const chosenAddressId = ref('1');
const list = [
    {
        id: '1',
        name: '张三',
        tel: '13000000000',
        address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
        isDefault: true,
    },
];

</script>

<style lang="scss" scoped>

</style>